package com.cs.study.homework.test;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class Demo2 {
    public static void main(String[] args) throws ParseException {
        Map<Student1,Date> stu = new HashMap<>();
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Date date1 = dateFormat.parse("2023-10-02");
        Date date2 = dateFormat.parse("2022-11-02");
        Date date3 = dateFormat.parse("2021-09-02");
        Date date4 = dateFormat.parse("2009-10-02");
        stu.put(new Student1("zs",18,"hubei"),date1);
        stu.put(new Student1("ls",17,"beijing"),date2);
        stu.put(new Student1("wu",19,"hubei"),date3);
        stu.put(new Student1("zl",21,"tianjin"),date4);

        System.out.println(stu);
    }

}

@Data
@AllArgsConstructor
class Student1{
    String name;
    int age;
    String address;
}
